﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Template.Master"
    Inherits="System.Web.Mvc.ViewPage<IProduct>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    修改产品
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div region="center" style="width: 500px; height: 100%; padding: 1px; position: relative;
        overflow-y: auto">
        <div id="jqeasyui-form">
            <form id="form-edit" action="<%=Url.Action("Edit") %>" method="POST" enctype="multipart/form-data">
            <%=Html.HiddenFor(o=>o.Id) %>
            <fieldset>
                <p>
                    <label>
                        产品名称:</label><input type="text" name="Name" value="<%=Model.Name %>" />
                  <%--  <label>
                        EN:</label><input type="text" name="NameEn" value="<%=Model.NameEn %>" />--%>
                </p>
                   <p style="display:none">
                    <label>
                        是否推荐:</label><%=Html.CheckBoxFor(o=>o.IsRecommend) %>
                </p>
                <p>
                    <label>
                        型号:</label><input type="text" name="Model" value="<%=Model.Model %>" />
                </p>
                      <p style="display:none">
                    <label>
                        产品分类:</label><select id="cc" name="CategoryId" editable="false">
                        </select>
                </p>
                <p>
                    <label>
                        图片:</label><input type="file" value="浏览" name="productImage" />
                </p>
                <p>
                    <label>
                        小图片:</label><input type="file" value="浏览" name="productSmallImage" /><span></span>
                </p>
                <p>
                    <label>
                        产品描述:</label>
                    <span class="span-textarea">
                        <textarea name="Description" id="Description" style="width: 800px; height: 400px;"><%=Model.Description %></textarea></span>
                </p>
                   <p style="display:none">
                    <label>
                        产品描述(EN):</label>
                    <span class="span-textarea">
                        <textarea name="DescriptionEn" id="DescriptionEn" style="width: 800px; height: 400px;"><%=Model.DescriptionEn %></textarea></span>
                </p>
                <p>
                    <label>
                        &nbsp;</label>
                    <input type="submit" value="保存" /></p>
            </fieldset>
            </form>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <link rel="stylesheet" href="/Content/Widget/kindeditor/plugins/code/prettify.css" />
    <script type="text/javascript" charset="utf-8" src="/Content/Widget/kindeditor/kindeditor.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Content/Widget/kindeditor/lang/zh_CN.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Content/Widget/kindeditor/plugins/code/prettify.js"></script>
    <script type="text/javascript">
        KindEditor.ready(function (K) {
            var editor1 = K.create('#Description', {
                cssPath: '/Content/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '<%=Url.Action("UploadFileProductJson") %>',
                fileManagerJson: '<%=Url.Action("FileManagerProductJson") %>',
                allowFileManager: true,
                afterCreate: function () {
                    var self = this;
                    K.ctrl(document, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                    K.ctrl(self.edit.doc, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                }
            });
            var editor2 = K.create('#DescriptionEn', {
                cssPath: '/Content/Widget/kindeditor/plugins/code/prettify.css',
                uploadJson: '<%=Url.Action("UploadFileProductJson") %>',
                fileManagerJson: '<%=Url.Action("FileManagerProductJson") %>',
                allowFileManager: true,
                afterCreate: function () {
                    var self = this;
                    K.ctrl(document, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                    K.ctrl(self.edit.doc, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                }
            });
        });


        $(document).ready(function () {
            $('#cc').combobox({
                url: '<%=Url.Action("GetProductComboBoxJson","Category",new{value=Model.CategoryId}) %>',
                valueField: 'id',
                textField: 'text'
            });
        });
    </script>
</asp:Content>
